import Vue from 'vue'

import App from './App'
import router from './router'
import store from './store'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)

import AdminDatastore from './db/AdminDb.js'
import BookDatastore from './db/BookDb.js'
import CategoryDatastore from './db/CategoryDb.js'
import LendDatastore from './db/LendDb.js'
import SysDatastore from './db/SysDb.js'
import UserDatastore from './db/UserDb.js'
import Settingstore from './db/SettingDb.js'

import uuid from 'node-uuid'

if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
Vue.config.productionTip = false
Vue.prototype.$AdminDatastore = AdminDatastore
Vue.prototype.$BookDatastore = BookDatastore
Vue.prototype.$CategoryDatastore = CategoryDatastore
Vue.prototype.$LendDatastore = LendDatastore
Vue.prototype.$SysDatastore = SysDatastore
Vue.prototype.$UserDatastore = UserDatastore
Vue.prototype.$Settingstore = Settingstore
import commonFunction from './commonFunction.js'
Vue.prototype.commonFunction = commonFunction

Vue.prototype.$uuid = uuid

	import VueLocalStorage from 'vue-localstorage'
	Vue.use(VueLocalStorage)
	import VueResource from 'vue-resource'
	
	Vue.use(VueResource);
/* eslint-disable no-new */
new Vue({
	components: {
		App
	},
	router,
	store,
	template: '<App/>'
}).$mount('#app')
